package org.lex.app.prefs;

import java.io.File;
import java.io.IOException;

import javax.swing.JButton;

import org.lex.utils.SystemProperties;


public class ResourceManagerTest {
	File home = new File(SystemProperties.tempDir(), ".ResourceManager");
	String name = "conf";

	public static void main(String[] args) {
		new ResourceManagerTest().testClasses(ResourceManagerTest.class, String.class, JButton.class);
	}

	public void testClasses(Class<?>... classes) {
		ResourceManager man = new ResourceManager(home, name);
		man.getResourceMap().putString("global", "resourcemap");
		for (Class<?> clz : classes) {
			ResourceMap rm = man.getResourceMap(clz);
			rm.putProperty(clz.getSimpleName(), clz);
		}
		try {
			man.save();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
